package org.wxl.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author 王学良
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("orders")
public class ordersEntity {
    /**
     *
     CREATE TABLE `orders` (
     `uuid` CHAR(36) NOT NULL COMMENT '订单ID',
     `user_id` VARCHAR(32) NOT NULL COMMENT '用户ID',
     `total_amount` DECIMAL(10,2) NOT NULL COMMENT '订单总金额',
     `order_status` VARCHAR(20) NOT NULL DEFAULT 'pending' COMMENT '状态（pending/paid/shipped/completed）',
     `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
     `updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
     PRIMARY KEY (`uuid`)
     ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='订单表';
     */
    @TableId(value = "uuid")
    @Schema
    private String uuid;

    @Schema(description = "用户ID")
    private String userId;

    @Schema(description = "订单总金额")
    private Double totalAmount;

    @Schema(description = "状态（pending/paid/shipped/completed）")
    private String orderStatus;

    @Schema(description = "创建时间")
    private LocalDateTime createdAt;

    @Schema(description = "更新时间")
    private LocalDateTime updatedAt;
}
